import {
    content as vertical_content,
    head as vertical_head,
    left as vertical_left,
    center as vertical_center,
    right as vertical_right,
    shadow as vertical_shadow,
} from '@/css/layout/Vertical.module.scss' ;

import {
    left as horizontal_left,
    center as horizontal_center,
    right as horizontal_right,
    content as horizontal_content,
    shadow as horizontal_shadow,
} from '@/css/layout/Horizontal.module.scss' ;
import {
    center,
    right,
    grid,
    input,
    button,
    search,
    header,
} from '@/css/DialogsCss.module.scss';
export default {
    title:'客户列表',
    dialog:{
        size:'50%'
    },
    layout:'tab',
    onMounted: [{
        action: 'set',
        target: '$widgets.formbasic',
        field: 'value',
        value: '$params'
    }],
    items:[{
        title:'基本信息',
        layout:'vertical',
        class: vertical_content,
        items:[{
            class: vertical_center,
            flex:1,
            items: [{
                layout: 'vertical',
                items: [{
                    id: 'formbasic',
                    widget: 'form',
                    layout: {
                        type:'gridform',
                        column:2
                    },
                    fields:[{
                        itemId:'name',
                        widget:'form-text',
                        label:'客户名称',
                    },{
                        itemId:'industry',
                        widget:'form-text',
                        label:'所属行业',
                    },{
                        itemId:'state_id',
                        widget:'form-text',
                        label:'客户状态',
                    },{
                        itemId:'contacts',
                        widget:'form-text',
                        label:'联系人',
                    },{
                        itemId:'salesman',
                        widget:'form-text',
                        label:'跟进人',
                    },{
                        itemId:'phone',
                        widget:'form-text',
                        label:'手机号码',
                    },{
                        itemId:'qq',
                        widget:'form-text',
                        label:'QQ号码',
                    },{
                        itemId:'wechat',
                        widget:'form-text',
                        label:'微信号码',
                    },{
                        itemId:'remarks',
                        widget:'form-text',
                        label:'备注说明',
                    },{
                        itemId:'current_stage_id',
                        widget:'form-text',
                        label:'当前阶段',
                    },{
                        itemId:'last_follow_time',
                        widget:'form-text',
                        label:'最近联系',
                    },{
                        itemId:'contents',
                        widget:'form-text',
                        label:'沟通内容',
                    },{
                        itemId:'next_plan_time',
                        widget:'form-text',
                        label:'下次跟进',
                    },{
                        itemId:'source_id',
                        widget:'form-text',
                        label:'客户来源',
                    },{
                        itemId:'label_id',
                        widget:'form-text',
                        label:'客户标签',
                    },{
                        itemId:'grade_id',
                        widget:'form-text',
                        label:'客户等级',
                    }],
                    flex: true
                }]
            }]
        }],
    },{
        title:'历史数据',
        order:2,
        layout:'vertical',
        class: vertical_content,
        items:[{
            class: vertical_center,
            flex:1,
            items:[{
                layout: 'horizontal',
                items:[{
                    id:'grid',
                    widget:'grid',
                    pageSize:20,
                    columns:[{
                        prop:'name',
                        label:'合同名称',
                        width: 120
                    },{
                        prop:'customer_id',
                        label:'关联客户',
                        width: 120
                    },{
                        prop:'amount_contract',
                        label:'合同金额',
                    },{
                        prop:'amount_return',
                        label:'回款金额',
                    },{
                        prop:'amount_arrears',
                        label:'欠费金额',
                    },{
                        prop:'amount_invoice',
                        label:'开票金额',
                    },{
                        prop:'sign_time',
                        label:'签订时间',
                    },{
                        prop:'expiration_time',
                        label:'到期时间',
                    }],
                    flex:true,
                }]
            }]
        }],
        onPage:[{
            action:'service',
            params:{
                page_size:'$widget.pageSize',
                page_no:'$params.page',
                keywords:'$widgets.search.value.keywords'
            },
            path:'contract/contract_list/list',
            actions:[{
                action:'set',
                target:'$widget',
                field:'value',
                value:'$params.data.items'
            },{
                action:'set',
                target:'$widget',
                field:'total',
                value:'$params.data.total'
            }]
        }],
        onMounted:[{
            action:'service',
            params:{
                page_size:'$widget.pageSize'
            },
            path:'contract/contract_list/list',
            actions:[{
                action:'set',
                target:'$widget',
                field:'value',
                value:'$params.data.items'
            },{
                action:'set',
                target:'$widget',
                field:'total',
                value:'$params.data.total'
            }]
        }]
    }]
};


